package com.zoanun.tools.sys.repository;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.stereotype.Repository;
import com.zoanun.tools.sys.model.*;

@Repository
public class RoleRepository {
	
	@Autowired
	private SqlMapClientTemplate sqlMapClientTemplate;
	
	public Role findRole(Role role) {
		return (Role) sqlMapClientTemplate.queryForObject("roles.findRole", role);
	}
	
	public void insertRole(Role role){
		sqlMapClientTemplate.insert("roles.insertRole", role);
	}
	
	public int deleteRole(Role role){
		return sqlMapClientTemplate.delete("roles.deleteRole", role);
	}
}
